package cn.kgc.itrip.config;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @program: love_travel
 * @description: 阿里支付
 * @author: Mr.Wang
 * @create: 2020-04-06 15:35
 **/

public class AlipayConfig {
    /*
    应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	  */
    public static String app_id = "2016101900725411";

    /*
    商户私钥，您的PKCS8格式RSA2私钥
     */
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCnHuZaK2l7Q+z/c+fpVcQntcz6AE2PTVaz4z4uZNLxtN+QNIkdxGl1EG9rou7Fbjja/EZ6WOt0kLgfTzxPe0Qk0+xYnacNPGRBAqaD8koBPa2OxI3eGMKaDkphTTsntJVCspKcg2aPACxWPPnZ1VllLyePf+Trx0J3NATgaJwLGf8s4OgV2TW0CXEDWuEyjIxKwxc/9rPIoEGAIJVG8uhmPr6BjrGPkFkyhhnvHmMqPS1wF33nN17KskC/4f0j2nLOY/PmBOBnnXtAEAllMCRmiUE5mCiqycUogKWu4FmODrIDx3prwQRKxiN0YH8cIR6rLISyJXGxfAVGihisdNd5AgMBAAECggEAOwm/drs/WDx2zQe1NckGssCW2Pqia612o7XzkZAstRago+DrT4jDeIeF1RCKKVT24OWeQDqJc3RslyL2u11ghWIYbHXFPffHsu+sw5AkdKvFVFo7g+pbVPEXdahC7ZPt5tIO2RvSb1IwV4bS/RFRs10lLJyR0nliEZpe3qgV+BV0Vbsp/8nLFZRAXt7TvhUIsAl4S7MIvTZGAGxu3gDQzG7Ndy9BAoaneEFg4uHezOpQyMHn59M3N9OmNIq7SDr/fHQ/5ULLKdZa535f7X4z9DGqJDFJ1nuiSc1mCKRredtl0J9cGC27X9e90hbNy+xdFgajlJvUAIvb32t+4lq/wQKBgQDhGlZYWBkeHrxwGXbg7cE/iiWQTKBKnXvmYIZu5yLmny2iVZKj4qYgHclsBk+Dp4nVfFC5lawc8YtcvxzY1Pbxhkv+LR+voIsbgZJnQZo1HnacqRJIItwhihKsXbs32EKLNda/SU+choVWHM3+T10OffGFg5+Ydi8zc95bgElXkwKBgQC+Dy9zqsc5vDrkZTYP3yVz+Nnw3fttDtiZgFln5TZHVjKdbrgGwYeRupaKeo7PbKl2K9Rh2Dt6Vv9IZtddxg/Td0oRZKcWdEHpljpSkltb4e3cwnbcYDz6bOVlK4XcM1VEN4DHQi3127+tkKpjZr+3sP41MbbCcwfcfX3vnizkQwKBgD8CqVLXbkiBIAxdBGrYArUvjW5EFMZuKOWG9XqL1rgprJN5Uq/vXMM2s1A6v/1BY5LP1qTsYZ5Eetc+Y+vKSUm4ZwNCTFFUJjxP29Rth6YA3gDiTszEfUwiIzH+ls5+CbqAGpm3AsL04NQHAh6CxrCsznOqMX1y76l+cKq6UU1jAoGAW/RE5RWPZmOnqrE9QtiX6lBQQbVk3BL+wOXUW+wOIt2Vh432A27HBL7d7wn05m6QXtg93UkdHcfRo1n+gSQ+q/VfJKMqJDcDXNyOQz0EbqQUzWZY067MUe0134j7Ltq3OlYQPFfMnNNBHdyMU6N2xo0fsOToo5O8DfW5ZKGG3rkCgYAeQeUdFFOkVR17hfOCFwdLh54k3ocoOEPLu4OdJsLyuyOEhNF69Go6djQZjWHuOtEwjyv23A+cLJkbGx2d/hSArOGHjFjcM1ePW/Ga/ZlUnsMhpC7YK9qWo948eFjjA+33Ny7lDIP2pwhnzKr60OsrmMG0Q4jNsnkNvtpYIMLKUw==";
    /*
     支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
      */
    public static String alipay_public_key = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIgHnOn7LLILlKETd6BFRJ0GqgS2Y3mn1wMQmyh9zEyWlz5p1zrahRahbXAfCfSqshSNfqOmAQzSHRVjCqjsAw1jyqrXaPdKBmr90DIpIxmIyKXv4GGAkPyJ/6FTFY99uhpiq0qadD/uSzQsefWo0aTvP/65zi3eof7TcZ32oWpwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://xtnayq.natappfree.cc/trade/api/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8083/trade/api/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "d:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
